<template>
  <!--⽬的任务：接收child01的消息并传给child02 -->
  <div id="parent">
    <child01 @getMsg="printMsg">
    </child01>
    <!-- ⽗类接收信息:{{msg}}, 传给组件2 -->
    <hr />
    <child02 :msg="msg">
    </child02>
  </div>
</template>
<script>
import child01 from '@/components/Child01'
import child02 from '@/components/Child02'
export default{
  data() {
    return{
      msg:'',
    }
  },
  components:{
    child01,child02
  },
  methods:{
    printMsg(data){
      this.msg=data
    }
  }
}
</script>
<style>
#parent{
  width:70vw;
  margin:5vw;
}
</style>